package cn.template;

import cn.template.config.Initializer;
import cn.template.services.UserService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class RestfulTemplateServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(RestfulTemplateServiceApplication.class, args);
    }

    @Bean
    public CommandLineRunner Initialize(UserService repository) {
        return (args) -> {
            Initializer initializer = new Initializer(repository);
            initializer.InitializeData();
        };
    }
}
